/**
 * 用户相关 API
 * @author 杨世峰
 */

import request from '@/utils/request'

export function register(data = {}) {
    return request({
        method: 'post',
        url: '/users',
        headers: {
            isToken: false
        },
        data: data
    })
}

export function login(data) {
    return request({
        method: 'put',
        headers: {
            isToken: false
        },
        url: '/users',
        data: data
    })
}

export function getUserInfo(userId) {
    return request({
        method: 'get',
        url: '/users/' + userId,
    })
}

export function modifyUserInfo(data) {
    return request({
        method: 'put',
        url: '/users/userId',
        data: data
    })
}